package club.janna.demo.reference.controller;

import club.janna.demo.api.domain.User;
import club.janna.demo.api.service.UserService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Panbo.Guo
 */
@RestController
@RequestMapping("user")
public class UserController {

    @DubboReference
    private UserService userService;

    @GetMapping("/{id}")
    public User get(@PathVariable("id") Long id) {
        return userService.getById(id);
    }
}
